<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div> web-view 的h5页面 </div>
  <script src="//res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
  <script src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script>
  <script>
    document.addEventListener("UniAppJSBridgeReady", function (e) {
      uni.getEnv(res => {
        wx.miniProgram.postMessage({ data: 'foo' })
        console.log('env: ', res)
      });
      uni.postMessage({
        data: {
          data: 'postMessage发送的数据信息',
          code: 1,
          message: '跳转成功'
        },
      });
      window.postMessage({
        data: 'postMessage发送的数据信息',
        code: 1,
        message: '跳转成功'
      }, "*");

    });
  </script>
</body>

</html>